    <div class="container">
      <div class="bg-putih">

        <div class="jdl-page">
          <?php echo isset($judul)?$judul:'<font color="#ccc">Judul Belum Diberikan</font>'; ?>
          <div class="clearfix"></div>
        </div>
        
        <?php echo display_flash(); ?>

        <div class="row">
          <div class="col-xs-8">
            <div class="btn-group btn-group-sm" role="group">
              <a href="<?php echo site_url('laporan_stok/excel'); ?>" class="btn btn-warning"><i class="fa fa-file-excel-o"></i>&nbsp;Unduh Excel</a>
            </div>
          </div>
          <div class="col-xs-4">
            <?php echo form_open('laporan_stok/cari'); ?>
            <div class="input-group input-group-sm">
              <select class="form-control" id="kelompok" name="keyword">
                <option value=""> - - Pilih Kelompok - - </option>
                <?php 
                  foreach($kelompok as $value) { 
                    if($KdKelompok == $value['KdKelompok']){
                      $s = "selected";
                    }else{
                      $s = "";
                    }
                    echo "<option value='$value[KdKelompok]' $s>$value[NmKelompok]</option>";
                  }
                ?>
              </select>
              <span class="input-group-btn">
                <button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span></button>
              </span>
            </div>
            <?php echo form_close(); ?>
          </div>
        </div>

        <table class="table table-striped table-hover margintop20">
          <thead>
            <tr>
              <th width="3%" style="text-align:center;">No</th>
              <th width="15%">Kode Obat</th>
              <th width="25%">Nama Obat</th>
              <th width="25%">Kelompok Obat</th>
              <th>Stok</th>
            </tr>
          </thead>
          <tbody>
            <?php 
              if(!empty($results)){
                foreach ($results as $row) {
            ?>
            <tr>
              <td align="center"><?php echo $ordinal_num++ ?></td>
              <td><?php echo $row['KdObat']?></td>
              <td><?php echo $row['NmObat']?></td>
              <td><?php echo $row['NmKelompok']?></td>
              <td>
                <?php 
                  $stok = $row['beli'] - $row['jual'] - $row['rusak'];
                  echo $stok;
                ?>
              </td>
            </tr>
            <?php 
                }
              }else{
            ?>
            <tr>
              <td colspan="4" align="center">Tida ada data</td>
            </tr>
            <?php
              }
            ?>
          </tbody>
        </table>

        <center style="margin-top:-30px;">
          <ul class="pagination">
            <?php echo $pagination; ?>
          </ul>
        </center>

        <div class="clearfix"></div>
      </div>
    </div> <!-- /container -->